home *** CD-ROM | disk | FTP | other *** search
-
- screenshare.library
- ===================
-
- This is a proposed scheme to allow applications ("symbionts") to
- open up windows on other applications' ("hosts") custom screens.
- There are many reasons for wanting to do this. For example, it is
- nice to be able to have AmigaREXX open up a file requester on your
- application's screen from outside of your application, and it is useful to
- be able to open up your editor on your terminal emulator's screen so you
- can write your messages while being able to see the contents of the
- terminal's screen. Sofar, this has only been possible by opening all
- applications on the Workbench. This causes excessive clutter, and limits
- you to the Workbench's number of colors and resolution mode.
- The scheme proposed here consists of an exec library to which
- prospective hosts can post their screen pointers and provide them with a
- unique name. Symbionts can query the same library and find, given the name,
- the pointer to the host's screen. The method is very simple, does not
- require SetFunction()ing any Amiga functions, does not take up very much
- room, is trivially easy to implement, and is, above all, safe if both hosts
- and symbionts obey the rules. This implies, however, that the method
- cannot be used transparently with existing applications not set up properly.
- This is just as well, because any scheme that tries to retrofit screen
- sharing to older applications requires trickery and is dangerous.
- There are six accessible functions in the screenshare.library, one of
- which is mainly a debugging tool and should not normally be called in an
- application. A typical host would call the functions: PublicScreen() to declare
- a screen public, PubScrLocked() to inquire whether there are any symbionts
- currently accessing the screen, and PrivateScreen() to revert a named public
- screen to private status. A typical symbiont would call the functions:
- LockPubScreen() to obtain a pointer to the Screen structure of a named public
- screen, and UnlockPubScreen() to signal to the library that all windows on a
- named public screen have been closed by the symbiont. All calls have a single
- argument, the name of the public screen (a null-terminated ascii string), with
- the exception of PublicScreen(), which has a pointer to the Screen structure
- as the second argument.
- It is possible for a program to be both a host and a symbiont, e.g.
- when the first instance of a program opens a screen, and subsequent instances
- want to open on that same screen.
- Further documentation can be found in the file pubscr.c, the main
- part of the screenshare.library.
- The functions can be accessed by linking the glue routines contained
- in liblink.asm to your host or symbiont.
-
- In this archive, you will find also three utilities: showscr, addscr,
- and addsym. Thes are intended for debugging purposes only, and should typically
- not be distributed with your software. Showscr shows the current list of
- shared screens. Addscr can fake a shared screen by adding one to the list. It
- can also remove shared screens from the list. Addsym can fake a symbiont
- opening up on a shared screen. It can also remove symbionts.
-
- These files are not in the public domain. They may, however, be
- distributed freely, and used freely, in any software, PD or commercial.
-
- Willy Langeveld 11 may 1988
-
-
-
- For this release: the documentation did not state previously that
- int return codes from functions are 16 bit values and should more properly
- be called short. Also, a minor bug was fixed.
-
- Willy Langeveld 7 september 1989
-